
var endtime = new Date("2019-09-05 18:00:00");

function seckill(){
    var nowtime = new Date();
    var disparity = endtime.getTime() - nowtime.getTime();
    disparity = disparity /1000;
    disparity = parseInt(disparity);

    if(disparity >= 0){
        h = parseInt(disparity /3600);
        m = parseInt((disparity / 60) % 60);
        s = parseInt(disparity % 60);
        if(h < 10){
            h = "0" + h;
        }
        if(m < 10){
            m = "0" + m;
        }
        if(s < 10){
            s = "0" + s;
        }

    }else {
        clearInterval(t);
    }
    document.querySelector("#h").innerHTML = h;
    document.querySelector("#m").innerHTML = m;
    document.querySelector("#s").innerHTML = s;
}
seckill();

var t = setInterval(function(){
    seckill();
},1000);
/*
var tt = setInterval(function(){
    var Daye = new Date();

    var seconds = MDaye.getTime() - Daye.getTime();



    var n1 = Math.floor(seconds / 3600);
    var n2 = Math.floor(seconds / 60 % 60);
    var n3 = Math.floor(seconds % 60);



    if(n1 < 10){
        n1 = "0" + n1;
    }
    if(n2 < 10){
        n2 = "0" + n2;
    }
    if(n3 < 10){
        n3 = "0" + n3;
    }

    document.querySelector("#h").innerHTML = n1;
    document.querySelector("#m").innerHTML = n2;
    document.querySelector("#s").innerHTML = n3;


    if (seconds > 0){
        clearInterval(tt);
    }

},1000);
*/

